{template 'web/common/common'}
{template 'web/problem/navbar'}
<link rel="stylesheet" type="text/css" href="../addons/kundian_farm/resource/css/style.css" />
<link rel="stylesheet" type="text/css" href="../addons/{php echo $_GPC['m']}/resource/swal/dist/sweetalert2.min.css" />
<div class="panel panel-success">
    <div class="panel-heading">
        <h3 class="panel-title">
            常见问题分类>编辑
        </h3>
    </div>
    <div class="panel-body">
        <form id="sign-form" class="form-horizontal" role="form" method="post" action="{url 'site/entry/problem',array('m'=>'kundian_farm','op'=>'problem_type_edit_save','version_id'=>$_GPC['version_id'])}" name="submit" style="padding: 20px 0;">
            <div class="form-group">
                <label class="col-sm-2 control-label">顶级分类</label>
                <div class="col-sm-8">
                    <select name="pid" id="selectParam" class="form-control">
                        <option value="0">请选择</option>
                        {loop $typeData $index $item}
                        <option value="{$item['id']}" <?php if($list['pid']==$item['id']){echo 'selected';}?>>{$item['type_name']}</option>
                        {/loop}
                    </select>
                    <span style="color: gray;">提示：如果不选择分类，则默认为顶级分类</span>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label">分类名称</label>
                <div class="col-sm-8">
                    <input type="text" class="form-control"  name="type_name" value="{$list['type_name']}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">是否显示</label>
                <div class="col-sm-8">
                    {if $list['status']==1}
                    <input type="checkbox" checked class="js-switch" value="1" name="status">
                    {else}
                    <input type="checkbox" class="js-switch" name="status" value="1">
                    {/if}
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">排序</label>
                <div class="col-sm-8">
                    <input type="text" class="form-control"  name="rank" value="{$list['rank']}">
                </div>
            </div>
            <div class="form-group">

                <div class="col-sm-offset-2 col-sm-10">
                    <input type="hidden" name="id" value="{$list['id']}">
                    <input type="submit" name="submit" class="btn btn-default">
                    <a class="btn btn-default" href="{url 'site/entry/problem',array('m'=>'kundian_farm','op'=>'problem_type')}">返回</a>
                </div>
            </div>
        </form>
    </div>
</div>

<script>
    require(["../addons/{php echo $_GPC['m']}/resource/swal/dist/sweetalert2.min.js"],function(){

    })
</script>